<?php 
/*
 module:		角色管理控制器
 create_time:	2021-07-27 18:11:24
 author:		
 contact:		
*/

namespace app\api\validate;
use think\validate;

class Order extends validate {

	protected $rule = [
		'passenger_id'=>['require'],
		'line_id'=>['require'],
		'shift_id'=>['require'],
		'up_site_id'=>['require'],
		'down_site_id'=>['require'],
		'device' => ['require'],
		'pay_type' => ['require'],
		'fid' => ['require'],
		'up_site_name' => ['require'],
		'down_site_name' => ['require'],

		'device_id' => ['require'],
		'ticket' => ['require'],
		'auth_code' => ['require'],
		'type' => ['require', 'in:1,2'],
		'lat' => ['require'],
		'lng' => ['require'],
		'sign' => ['require'],
	];

	protected $message = [
		'passenger_id.require'=>'出行人不能为空',
		'line_id.require'=>'线路不能为空',
		'shift_id.require'=>'班次不能为空',
		'up_site_id.require'=>'上车点不能为空',
		'down_site_id.require'=>'下车点不能为空',
		'device.require'=>'下单设备不能为空',
		'pay_type.require'=>'支付类型不能为空',
		'fid.require'=>'fid不能为空',
		'up_site_name.require'=>'上车点名称不能为空',
		'down_site_name.require'=>'下车点名称不能为空',

		'device_id.require'=>'设备ID不能为空',
		'ticket.require'=>'验票编码不能为空',
		'auth_code.require'=>'授权码不能为空',
		'type.require'=>'支付类型不能为空',
		'type.in'=>'支付类型只能是1或者2', //1微信支付，2支付宝
		'lat.require'=>'纬度不能为空',
		'lng.require'=>'经度不能为空',
		'sign.require'=>'签名不能为空',
	];

	protected $scene  = [
		'create'=>['passenger_id','line_id','shift_id','up_site_id','down_site_id','device', 'up_site_name', 'down_site_name'],
		'checkTicket' => ['device_id', 'ticket', 'sign'],
		'microOrder' => ['auth_code','device_id']
	];
}

